<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
    <input type="file" multiple>

    <script>
        const inp = document.querySelector('input');
        //FormData
        inp.addEventListener('change',e=>{
            const files = e.target.files;
            const form = new FormData;
            Array.from(files).forEach(item=>{
                form.append(item.name,item)
            })
            axios.post('http://123.206.55.50:11000/upload',form).then(res=>{
                console.log(res)
            }).catch(error=>{
                console.log(error)
            })
        })
        //base64 
        // inp.addEventListener('change',e=>{
        //     const files = e.target.files;
        //     const reader = new FileReader;
        //     reader.onload=function(){
        //         console.log(this.result);
        //         axios.post('http://123.206.55.50:11000/upload_base64',{base64:this.result}).then(res=>{
        //             console.log(res)
        //         }).catch(error=>{
        //             console.log(error);
        //         })
        //     }
        //     reader.readAsDataURL(files[0])
        // })
    </script>
</body>
</html>